/* Copyright (c) 2004-2024 peigen.info. All rights reserved. */

package info.peigen.hotpot.business.account.facade.order.trans;

import cn.hutool.core.lang.Assert;
import info.peigen.hotpot.business.router.facade.enums.ChannelCode;
import info.peigen.hotpot.common.core.result.ResultCode;
import info.peigen.hotpot.common.service.base.exception.BusinessException;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

import static info.peigen.hotpot.business.router.facade.enums.ChannelCode.Weixin;

/**
 * <b>(TransferOrder)</b>
 * 转账账务交易
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/12
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class TransferOrder extends AbstractAccountTransServiceOrder {
    /** 付款账户Id */
    String payerAccountId;
    /** 收款账户Id */
    String payeeAccountId;
    /** 渠道编码 */
    @Builder.Default
    ChannelCode channelCode = Weixin;

    @Override
    public void check() {
        Assert.notEmpty(new String[]{payerAccountId, payeeAccountId}, () -> new BusinessException(ResultCode.FAILURE, "payerAccountId,payeeAccountId不得同时为空!"));
    }
}